const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
  chainWebpack: (config) => {
    config.plugin("ProvidePlugin").use(webpack.ProvidePlugin, [
      {
        $: "jquery",
        jQuery: "jquery",
      },
    ]);

    config.plugin("CopyWebpackPlugin").use(CopyWebpackPlugin, [
      {
        patterns: [
          {
            from: path.resolve(__dirname, "./src/img"),
            to: path.resolve(__dirname, "./dist/img"),
          },
        ],
      },
    ]);
  },
};
